package com.forward;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/admin")
public class AdminForward {

    /**
     * 管理员
     */
    @RequestMapping("/index")
    public String index() {
        return "redirect:/admin/welcome";
    }

    @RequestMapping(value = "/query-specific-admin")
    public String querySpecificAdmin() {
        return "admin/query-specific-admin";
    }

    @RequestMapping(value = "/query-low-inventory-drug-list")
    public String queryLowInventoryDrugList() {
        return "admin/query-low-inventory-drug-list";
    }

    @RequestMapping(value = "/profile")
    public String profile() {
        return "admin/profile";
    }

    @RequestMapping(value = "/welcome")
    public String welcome() {
        return "admin/welcome";
    }

    @RequestMapping(value = "/query-supplier-list")
    public String querySupplierList() {
        return "admin/query-supplier-list";
    }

    @RequestMapping(value = "/add-supplier-form")
    public String addSupplierForm() {
        return "admin/supplier-form";
    }

    @RequestMapping(value = "/query-close-2-expiry-pdbatch-list")
    public String queryClose2ExpiryPDbatchList() {
        return "admin/query-close-2-expiry-pdbatch-list";
    }

    @RequestMapping(value = "/query-drug-list")
    public String queryDrugList() {
        return "admin/query-drug-list";
    }

    @RequestMapping(value = "/query-pdbatch-list")
    public String queryBatchList() {
        return "admin/query-pdbatch-list";
    }

    @RequestMapping(value = "/query-destroyed-pdbatch-list")
    public String queryDestroyList() {
        return "admin/query-destroyed-pdbatch-list";
    }

    @RequestMapping(value = "/add-storage-form")
    public String addStorageForm() {
        return "admin/storage-form";
    }

    //供应商
    @RequestMapping(value = "/query-specific-supplier")
    public String querySpecificSupplier(@RequestParam("Sno") String Sno, HttpServletRequest request) {
        request.getSession().setAttribute("Sno", Sno);
        return "admin/query-specific-supplier";
    }

    @RequestMapping(value = "/edit-supplier-form")
    public String editSupplierForm() {
        return "admin/supplier-form";
    }

    //药品
    @RequestMapping(value = "/query-specific-drug")
    public String querySpecificDrug() {
        return "admin/query-specific-drug";
    }

    @RequestMapping(value = "/specific-storage-form")
    public String specificStorageForm() {
        return "admin/specific-storage-form";
    }

    //新建处方
    @RequestMapping(value = "/add-rx-form")
    public String addRxForm() {
        return "admin/rx-form";
    }


    //查看未处理处方列表
    @RequestMapping(value = "/query-unsolved-rx-list")
    public String queryUnsolvedRxList() {
        return "admin/query-unsolved-rx-list";
    }

    //查已处理处方列表
    @RequestMapping(value = "/query-solved-rx-list")
    public String querySolvedRxList() {
        return "admin/query-solved-rx-list";
    }
}
